import Verify from '@/components/Items/Verify'
import DialogClose from '@/mixins/suplier/Ar/DialogClose'
export default {
  mixins: [DialogClose],
  components: {
    Verify
  },
  data () {
    return {
      checkList: [],
      isLoading: false,
      captcha: '', // 验证码
      preCode: '',
      phoneInfo: '',
      step: 1 // 步骤
    }
  },
  methods: {
    beforeSubmit: beforeSubmit,
    handleNext: handleNext,
    init: Init
  }
}
// 点击我知道了跳到下一步
function handleNext () {
  this.axios.post('/commonCust/queryCorpRequest', {}).then(res => {
    if (res.data.status) {
      this.phoneInfo = res.data.data
      this.step = 2
    } else {
      this.handleClose() // 关闭弹窗
      this.$alert(`<p>${res.data.msg}</p>`, '系统提示', {
        dangerouslyUseHTMLString: true
      })
    }
  }).catch(err => {
    console.log(err)
  })
}
function beforeSubmit () {
  if (this.checkList.length !== this.detailsP.contractList.length) {
    this.$message({
      type: 'error',
      message: '有未勾选合同'
    })
    return
  }
  this.step = 3
}
// 初始化
function Init () {
  this.checkList = []
  this.captcha = ''
  this.preCode = ''
  this.step = 1
}
